#!/bin/bash
# ***************************************************************
# *                    simula+@metz.ensam.fr                    *
# *	              GNU/linux version 2.4.0                   *
# *            software under General Public License            *
# ***************************************************************
# * copyright © 2003,2004,2005,2006,2007,2009 COLLARD Christophe
# * copyright © 2003,2004,2005,2006,2007,2009 Laboratoire de Physique et Mécanique des Matériaux (LPMM - CNRS)
# * copyright © 2003,2004,2005,2006,2007 Laboratoire de Mathématiques et ses Applications de Valenciennes (LAMAV)
# ***************************************************************/

#    run MOL++ belongs to Mathematical Object Libraries (MOL++) </br>
#    MOL++ is part of Simula+ <br><br>
#
#    Simula+ is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version. <br><br>
#
#    Simula+ is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details. <br><br>
#
#    You should have received a copy of the GNU General Public License
#    along with Simula+; if not, write to the Free Software
#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA


# color definition
GREEN="\\033[1;32m"
NORMAL="\\033[0;39m"
RED="\\033[1;31m"
PINK="\\033[1;35m"
BLUE="\\033[1;34m"
WHITE="\\033[0;02m"
LIGHTWHITE="\\033[1;08m"
YELLOW="\\033[1;33m"
CYAN="\\033[1;36m"


# checks Simula+ has been started correctly
if [ "$rat" != "true" ]; then
    echo -e $RED"Please, configure & execute 'run simula+ tests' to start tests"$NORMAL
    exit
fi


cd MOL++
if [ -f MOL++.exe ]; then 
    rm MOL++.exe
fi
$compiler -w -I $SimulaPlus -o MOL++.exe tests-MOL++.cpp
if [ -f MOL++.exe ]; then 
     ./MOL++.exe
     rm MOL++.exe
     rm *.res
else if [ -f ../simula+.old ]; then
        mv -f ../simula+.old ../simula+.bak
     fi
fi
cd ..
